<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/login.css">
</head>
<body>
     <header>
        <p><img src="../img/HUAWEI.svg" alt=""></p>
     </header>
     
     <main>
        <div class="main-box">
            <h2>华为账号登录</h2>
            <div class="fullpage">
                <div class="fullpage-left">
                    <div class="erimg">
                        <img src="../img/erwm.png" alt="">
                    </div>
                    <p>若您使用华为手机，请前往“设置”>“华为账号”扫码登录。</p>
                </div>
                <div class="fullpage-right">
                    <input type="text" id="username" placeholder="手机号/邮件地址/账户号"><br>
                    <input type="password"id = "password" placeholder="密码"><br>
                    <span class="captcha"><a href="#">短信验证码登录</a></span><br>
                    <input type="button" value="登录" id="loginbtn" >
                    <p class="logonRow"><span>注册</span>|<span>忘记密码</span>|<span>遇到问题</span></p>
                    <p class="fullpage-right-img">
                        <span><img src="../img/QQ.png" alt=""></span>
                        <span><img src="../img/zfb.png" alt=""></span>
                        <span><img src="../img/wx(2).png"></span>
                    </p>
                    
                </div>
            </div>
        </div>
     </main>
     <footer>
        <div class="footer-box">
            <p>
                <span>华为账号用户协议</span>|
                <span>关于华为账号与隐私的声明</span>|
                <span>管理式华为账号服务协议</span>|
                <span>关于管理式华为账号与隐私的声明</span>|
                <span>常见问题</span>|
                <span>Cookies</span>
            </p>
            <p>华为账号 版权所有 © 2011-2025</p>
        </div>
     </footer>
</body>
<script>
    // 获取输入框和按钮
    const username = document.getElementById("username");
        const password = document.getElementById("password");
        const loginBtn = document.getElementById("loginbtn");

        // 检查输入框内容是否为空
        function checkInputs() {
            if (username.value.trim() !== "" && password.value.trim() !== "") {
                // 如果两个输入框都有内容，按钮变红色并启用
                loginBtn.classList.add("enabled");
                loginBtn.disabled = false;
            } else {
                // 如果任意一个输入框为空，按钮恢复默认样式并禁用
                loginBtn.classList.remove("enabled");
                loginBtn.disabled = true;
            }
        }

        // 监听输入框的变化
        username.addEventListener("input", checkInputs);
        password.addEventListener("input", checkInputs);

        // 初始化检查（页面加载时）
        checkInputs();

    document.getElementById("loginbtn").addEventListener("click", function() {
        window.location.href = "/HUAWEI/html/index.html"; // 同一窗口
        // 或 window.open("https://example.com", "_blank"); // 新标签页
    });
</script>
</script>
</html>